package com.itheima.api;

import com.itheima.domain.Student;

import java.util.Objects;

/*
Objects
toString
toString

 */
public class Demo05 {
    public static void main(String[] args) {
        Student stu=new Student("坤坤",26);
        System.out.println(stu);//null
        //System.out.println( stu.toString()); //空指针异常
        System.out.println(Objects.toString(stu));//防止空针异常
        System.out.println(Objects.toString(stu, "我也不知道传sha"));//给提供默认值

    }


}



